#include"search.hpp"

const std::string sorce="data/raw_html/raw.txt";

int main()
{
    ns_search::Searcher se;
    se.InitSearcher(sorce);

    while(true)
    {
        std::string query;
        char buffer[1024];
        std::cout<<"Please enter what your want to search: ";
        
        fgets(buffer,sizeof(buffer)-1,stdin);

        //去掉最后的换行符
        buffer[strlen(buffer)-1]=0;
        query=buffer;

        std::string result;
        se.Serach(query,&result);

        std::cout<<result<<std::endl;
        
    }

    return 0;
}